import App from './App'

import {
    router,
    RouterMount
} from './router.js' //路径换成自己的
Vue.use(router)

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
// #endif

// #ifdef VUE3
import {
    createSSRApp
} from 'vue'

export function createApp() {
    const app = createSSRApp(App)
    return {
        app
    }
}
// #endif
Vue.prototype.tostMsg = function(title, icon, duration) {
    title = title || 'default'
    icon = icon || 'none'
    duration = duration || 2000
    uni.showToast({
        title: title,
        icon: icon,
        duration: duration
    })
}
Vue.prototype.showLoading = function(title, duration) {
    title = title || '加载中...'
    duration = duration || 2000
    uni.showLoading({
        title: title,
        duration: duration
    })
}
Vue.prototype.hideLoading = function(){
    uni.hideLoading();
}
// #ifdef H5
RouterMount(app, router, '#app')
// #endif
// #ifndef H5
app.$mount();
// #endif